/*
 * CodeSaveCommand.java
 *
 * Created on 2006년 3월 29일 (수), 오후 4:11
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.qbooks.member;

import java.util.*;





import javax.servlet.*;
import javax.servlet.http.*;

import org.json.simple.JSONObject;

import com.zll.framework.model.HashBox;
import com.zll.framework.model.HashList;
import com.zll.framework.servlet.Command;
import com.zll.framework.util.StringUtil;
import com.qbooks.common.CommonDAO;
import com.qbooks.common.CommonUtil;



/**
 *
 * @author eastar
 */
public class LogoutCommand implements Command
{

    public String execute(HttpServletRequest  request, HttpServletResponse response)
    throws Exception
    {
    	HttpSession session = request.getSession();
    	session.invalidate();

    	if ("json".equals(request.getAttribute("data_type"))) {
    		JSONObject json = new JSONObject();
    		json.put("result", 	"true");
    		request.setAttribute("jsonData", json.toString());
        	return "/common/json_view.jsp";
    	}
    	else {
    		HashMap result		= new HashMap();
    		result.put("result", 	"true");
    		result.put("action",	"/m/member");

        	request.setAttribute("result", result);

        	return "/common/move_view.jsp";
    	}
    		
    	
    }
}
